package com.haiyangwang.selesson;

import lesson1.Team;

public class Team1 {
    Student[] students;
    Teacher teacher;


    public void addStudent(Student student,int i) {
        if (i<students.length){
        students[i]=student;
        }
    }
    public Team1(){
        students=new Student[3];
        teacher=new Teacher("","");
    }
    public void listAllStudent(){
        String name="";
        String no="";
        for (int i=0;i<students.length;i++){
            name=students[i].studentName;
            no=students[i].studentNo;
            System.out.println("学号为："+no+"姓名为："+name);
            students[i].learn();
            students[i].eat();
        }
    }

    public void addTeacher(Teacher teacher) {
        this.teacher=teacher;
    }
    public void listAllTeacher(){
        String name1 = teacher.name;
        String course=teacher.course;
        System.out.println(name1+"老师"+"教授的课程为："+course);
    }



}
